package lcspm.commands;

import java.util.List;
import lcspm.lib.BackHandler;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;

public class CommandBack
  implements ICommand
{
  public int compareTo(Object arg0)
  {
    return 0;
  }

  public String getCommandName()
  {
    return "back";
  }

  public String getCommandUsage(ICommandSender icommandsender)
  {
    return "/" + getCommandName();
  }

  public List getCommandAliases()
  {
    return null;
  }

  public void processCommand(ICommandSender icommandsender, String[] astring)
  {
    if ((icommandsender instanceof EntityPlayer))
    {
      EntityPlayer player = (EntityPlayer)icommandsender;

      player.travelToDimension(BackHandler.dim);
      player.setPositionAndUpdate(BackHandler.posX.doubleValue(), BackHandler.posY.doubleValue(), BackHandler.posZ.doubleValue());
    }
  }

  public boolean canCommandSenderUseCommand(ICommandSender icommandsender)
  {
    return true;
  }

  public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring)
  {
    return null;
  }

  public boolean isUsernameIndex(String[] astring, int i)
  {
    return false;
  }
}